package go_leetcode

func minDeletion(nums []int) int {
	res := 0
	i, length := 0, len(nums)
	for i < length {
		if i + 1 == length {
			res++
			break
		}
		if nums[i] == nums[i+1] {
			res++
			i++
			continue
		}
		i += 2
	}
	return res
}